package com.decent.ejfadmin.report.dao;

import com.decent.ejfadmin.common.bean.Page;
import com.decent.ejfadmin.report.dao.provider.CollectCardReportDaoProvider;
import com.decent.ejfadmin.report.entity.OperatorReportDTO;
import com.decent.ejfadmin.report.request.ReportQueryParam;
import com.decent.ejfadmin.report.response.CollectCardAreaReportDto;
import com.decent.ejfadmin.report.response.CollectCardOperatorReportDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * @author weicx
 * @date 2018/08/01
 */
@Mapper
@Repository
public interface CollectCardReportDao {
    /**
     * 收卡地区统计计数
     *
     * @param reportQueryParam 查询bean
     * @return list
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "queryAreaReportCount")
    int queryAreaReportCount(@Param("queryBean") ReportQueryParam reportQueryParam);

    /**
     * 收卡地区统计
     *
     * @param reportQueryParam 查询bean
     * @param page             分页组件
     * @return list
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "queryAreaReport")
    List<CollectCardAreaReportDto> queryAreaReport(@Param("queryBean") ReportQueryParam reportQueryParam, @Param("page") Page page);

    /**
     * 收卡运营商统计计数
     *
     * @param operatorReport
     * @return
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "queryOperatorReportCount")
    int queryOperatorReportCount(@Param("operatorReport") OperatorReportDTO operatorReport);

    /**
     * 收卡运营商统计
     *
     * @param pageUnit
     * @param operatorReport
     * @return
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "queryOperatorReport")
    List<CollectCardOperatorReportDto> queryOperatorReport(@Param("pageUnit") Page pageUnit,
                                                           @Param("operatorReport") OperatorReportDTO operatorReport);

    /**
     * 收卡运营商统计
     *
     * @param pageUnit
     * @param operatorReport
     * @return
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "queryEquityOperatorReport")
    List<CollectCardOperatorReportDto> queryEquityOperatorReport(@Param("pageUnit") Page pageUnit, @Param("operatorReport") OperatorReportDTO operatorReport);

    /**
     * 收卡销卡统计计数
     *
     * @param reportQueryParam 查询bean
     * @return 总数
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "actualSupplyCardReportCount")
    int actualSupplyCardReportCount(@Param("reportQueryParam") ReportQueryParam reportQueryParam);

    /**
     * 分页查询收卡销卡统计
     *
     * @param reportQueryParam 查询bean
     * @param pageUnit         分页组件
     * @return list
     */
    @SelectProvider(type = CollectCardReportDaoProvider.class, method = "actualSupplyCardReportPage")
    List<HashMap<String, Object>> actualSupplyCardReportPage(@Param("reportQueryParam") ReportQueryParam reportQueryParam, @Param("pageUnit") Page pageUnit);
}
